﻿using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WisDom.SmartTMS.InterFace;

namespace WisDom.SmartTMS.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController] //所有api控制器必须要有这个注解
    public class UsersController: SmartTMSController    //必须继承基类
    {
        //依赖注入
        private readonly IUserAppService _appService;

        public UsersController(IUserAppService appService)
        {
            _appService = appService;
        }

        /// <summary>
        /// 登录接口
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> UserDtoLogin(string userNo, string password)
        {
            var user = await _appService.Get(userNo, password);
            return Ok(new { data = user, code = 200, msg = "登录成功" });
        }
    }
}
